<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DomainModel.Entities.User>" %>
<div>
<%= Html.ValidationSummary("Submit was unsuccessful. Please correct the errors and try again.")%>

    <% using (Html.BeginForm("UserEdit", "User", FormMethod.Post, new { enctype = "multipart/form-data" }))
       { %>
    <!--Hidden if for update-->
    <%= Html.Hidden("UserID")%>
    <%= Html.Hidden("LoginTimes")%>
    <%= Html.Hidden("UserRole")%>
    <%= Html.Hidden("OpenID")%>
    <%= Html.Hidden("DateLastLogin")%>
    <%= Html.Hidden("ImageName")%>
    <div class="zone_single">
        <h3>Account Information</h3>
        <div class="user_detail_image float_left">
            <%= Html.Image(ResolveUrl(Settings.UserImagePath + Model.ImageName),"user image", new {@class="user-detail-image"}, "user image")%>

            <%= Html.ActionLink("Update Image", "ImageUpload", "User", null, new{@class = "site_link_04"})%>
        </div>
        <div class="float_left user_details">
            <p>
                <label>
                    Nick name:</label>
                <%= Html.TextBox("Name") %>
            </p>
            <p>
                <label>
                    Email:</label>
                <%= Html.TextBox("Email") %>
                <%= Html.ValidationMessage("Email") %>
            </p>
            <p>
                <label>
                    OpenID:</label>
                <i><b>
                    <%= Model.OpenID %></b></i>
            </p>
            <p>
                <label>
                    About:</label>
                <br />
                <%= Html.TextArea("About", Model.About, new { rows = "5", cols="30"})%>
                <%= Html.ValidationMessage("About")%>
            </p>
            <p>
                <label>
                    Last Login:</label>
                <i>
                    <%= Model.DateLastLogin %></i>
            </p>
            <p>
                <input type="submit" class="button" value="Submit" />
                <input type="button" value="Cancel" class="button" onclick="history.go(-1)" />
            </p>
        </div>
    </div>
    <% } %>
</div>
